import { Component, OnInit, EventEmitter,Input,Output } from '@angular/core';
import { CommonFile } from './upload.interface';

@Component({
  selector: 'el-upload-list',
  templateUrl: './upload-list.component.html'
})
export class UploadListComponent implements OnInit {
  @Input() files: CommonFile[]=[];
  @Input() disabled: boolean=false;
  @Input('list-type') listType: string='';
  @Output() remove: EventEmitter<CommonFile>=new EventEmitter();
  @Output() preview: EventEmitter<CommonFile>=new EventEmitter();

  constructor() { }

  ngOnInit(): void {
  }


  clickHandle(file: CommonFile): void {

  };
  removeHandle(file: CommonFile): void {
    this.remove.emit(file);
  };
  previewHandle(file: CommonFile): void {
    this.preview.emit(file);
  };

}
